package route

import "encoding/json"

type Result struct {
	Code int `json:"code"`
	Data interface{} `json:"data"`
	Msg interface{} `json:"msg"`
}
func (r Result) Success(data interface{})[]byte{
	bytes,_:=json.Marshal(&Result{1000,data,"success"})
	return bytes
}

func (r Result) Fail(msg interface{})[]byte{
	bytes,_:=json.Marshal(&Result{900,"",msg})
	return bytes
}
